package net.xiduth.game.player.content;

import net.xiduth.game.Animation;
import net.xiduth.game.ForceTalk;
import net.xiduth.game.Hit;
import net.xiduth.game.Hit.HitLook;
import net.xiduth.game.item.Item;
import net.xiduth.game.player.Player;
import net.xiduth.game.player.Skills;
import net.xiduth.utils.Utils;

public class RoguesDen {
	
	@SuppressWarnings("unused")
	private Item[][] items = {
			{ new Item(1617), new Item(1619), new Item(1621), new Item(1623) },
			{ new Item(1625), new Item(2631) }, };
	
	public static int safe = 7235;
	public static int listening = 2247;
	public static int pickingLock = 2246;
	public static int ONE = 1;
	public static int TWO = 2;
	public static int THREE = 3;
	public static int EXP = 350;
	public static int EXP2 = 220;
	public static boolean startPicking(Player player) {
		if (player.getInventory().getFreeSlots() < 1) {
			player.getPackets().sendGameMessage("Not enough room in your inventory to continue");
			return false;
		}
		if (player.getSkills().getLevel(Skills.THIEVING) > 40) {
			if (Utils.getRandom(2) == 0) {
				switch (Utils.getRandom(2)) {
				case 0:
					player.setNextAnimation(new Animation(pickingLock));
					player.getSkills().addXp(17, EXP);
					player.lock(2);
					break;
				case 1:
					player.setNextAnimation(new Animation(listening));
					player.getPackets().sendGameMessage("You attempt to crack the safe.");
					player.lock(2);
					player.setNextAnimation(new Animation(pickingLock));
					player.getSkills().addXp(17, EXP2);
					player.lock(2);
					return true;
				case 2:
					player.setNextAnimation(new Animation(listening));
					player.lock(1);
					player.getPackets().sendGameMessage("You fail to pick the lock.");
					player.lock(1);
					player.setNextForceTalk(new ForceTalk("Ow!"));
					player.lock(1);
					player.applyHit(new Hit(player, 57, HitLook.REGULAR_DAMAGE, 0));
					return true;
				}
				}
		}
		return false;
	}
	
	
	public static boolean handleObjects(Player p, int objectId) {
		if (objectId == safe) {
			startPicking(p);
		}
		return false;
	}
	
	
	

}